package com.lcxw.hxzbadmin.dao.configmapper;

import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;
import com.lcxw.hxzbadmin.entity.configbean.YwpdAnnounce;

@Mapper
@Component
public interface AnnounceMapper {

    @Delete({
        "delete from ywpd_announce",
        "where `id` = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into ywpd_announce (`title`, `addTime`, ",
        "`fengMian`, `zhuangTai`, ",
        "`content`)",
        "values (#{title}, #{addTime}, ",
        "#{fengMian}, #{zhuangTai}, ",
        "#{content})"
    })
    int insert(YwpdAnnounce record);

    @Select("select * from ywpd_announce where `id` = #{id}")
    YwpdAnnounce selectById(int id);

    @Select("select * from ywpd_announce")
    List<YwpdAnnounce> selectAll();

    @Update({
        "update ywpd_announce",
        "set `title` = #{title,jdbcType=VARCHAR},",
        "`addTime` = #{addTime,jdbcType=TIMESTAMP},",
        "`fengMian` = #{fengMian,jdbcType=VARCHAR},",
        "`zhuangTai` = #{zhuangTai,jdbcType=CHAR},",
        "`content` = #{content}",
        "where `id` = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(YwpdAnnounce record);
}
